import { http } from '@/utils/http/axios';


/**
 * @description: 获取班组table展示数据
 */
export function getTableList(params) {
  return http.request({
    url: '/group/group_data',
    method: 'get',
    params: params,
  });
}

/**
 * @description: 获取项目信息下拉框数据
 */
export function getProjcetOptions(params) {
  return http.request({
    url: '/group/projectOptions',
    method: 'GET',
    params: params,
  });
}

/**
 * @description: 获取班组下拉框信息数据
 */
export function getGroupOptions(params) {
  return http.request({
    url: '/group/groupOptions',
    method: 'GET',
    params: params,
  });
}

/**
 * @description: 批量删除选中的数据
 */
export function batchDelGroup(params) {
  return http.request({
    url: '/group/batchDelGroup',
    method: 'POST',
    data: params,
  });
}

/**
 * @description: 创建班组
 */
export function createGroup(params) {
  return http.request({
    url: '/group/add_group',
    method: 'POST',
    params,
  });
}

/**
 * @description: 更新班组
 */
export function updateGroup(params) {
  return http.request({
    url: '/group/update_group',
    method: 'POST',
    params,
  });
}

/**
 * @description: 导入班组信息数据
 */
export function uploadGroupExcel(params) {
  return http.uploadFile({
    url: '/group/uploadgroupexcel',
  },params);

}

//导出班组信息数据
export function getGroupExcel(params) {
  return http.request({
    url: '/group/getgroupexcel',
    method: 'get',
    responseType : 'blob',
    params,
  });
}
